#pragma once
#include "Event.h"

namespace Orange
{
    class MouseMovedEvent : public Event
    {
    public:
        MouseMovedEvent(float x, float y) : m_Posx(x), m_Posy(y) {}

        inline float GetX() { return m_Posx; }
        inline float GetY() { return m_Posy; }
        std::string ToString() const override
        {
            std::stringstream ss;
            ss << "MouseMovedEvent:"
               << "(" << m_Posx << "," << m_Posy << ")";
            return ss.str();
        }

#ifdef ORANGE_VS
        EVENT_CLASS_CATEGORY(EventCategoryMouse | EventCategoryInput);
        EVENT_CLASS_TYPE(MouseMoved);
#else
        virtual int GetEventCategory() const override
        {
            return EventCategoryMouse | EventCategoryInput;
        };
        static EventType GetStaticEventType()
        {
            return EventType::MouseMoved;
        };
        virtual EventType GetEventType() const override { return GetStaticEventType(); };
        virtual const char *GetName() const override { return "MouseMoved"; };
#endif
    protected:
        float m_Posx;
        float m_Posy;
    };

    class MouseScrolledEvent : public Event
    {
    public:
        MouseScrolledEvent(float x, float y) : m_OffsetX(x), m_OffsetY(y)
        {
        }
        inline float GetOffsetX() { return m_OffsetX; }
        inline float GetOffsetY() { return m_OffsetY; }
        std::string ToString() const override
        {
            std::stringstream ss;
            ss << "MouseScrolledEvent:"
               << "(" << m_OffsetX << "," << m_OffsetY << ")";
            return ss.str();
        }

#ifdef ORANGE_VS
        EVENT_CLASS_CATEGORY(EventCategoryMouse | EventCategoryInput);
        EVENT_CLASS_TYPE(MouseScrolled);
#else
        virtual int GetEventCategory() const override
        {
            return EventCategoryMouse | EventCategoryInput;
        };
        static EventType GetStaticEventType()
        {
            return EventType::MouseScrolled;
        };
        virtual EventType GetEventType() const override { return GetStaticEventType(); };
        virtual const char *GetName() const override { return "MouseScrolled"; };
#endif

    private:
        float m_OffsetX;
        float m_OffsetY;
    };

    class MouseButtonEvent : public Event
    {
    public:
        inline int GetButton() const { return m_Button; };

#ifdef ORANGE_VS
        EVENT_CLASS_CATEGORY(EventCategoryMouseButton | EventCategoryInput);

#else
        virtual int GetEventCategory() const override
        {
            return EventCategoryMouseButton | EventCategoryInput;
        };

#endif
    protected:
        MouseButtonEvent(int button) : m_Button(button){};
        int m_Button;
    };

    class MouseButtonPressedEvent : public MouseButtonEvent
    {
    public:
        MouseButtonPressedEvent(int button) : MouseButtonEvent(button)
        {
        }

        std::string ToString() const override
        {
            std::stringstream ss;
            ss << "MouseButtonPressedEvent:"
               << "button" << m_Button;
            return ss.str();
        }

#ifdef ORANGE_VS
        EVENT_CLASS_TYPE(MouseButtonPressed);
#else
        static EventType GetStaticEventType()
        {
            return EventType::MouseButtonPressed;
        };
        virtual EventType GetEventType() const override { return GetStaticEventType(); };
        virtual const char *GetName() const override { return "MouseButtonPressed"; };
#endif
    };

    class MouseButtonReleasedEvent : public MouseButtonEvent
    {
    public:
        MouseButtonReleasedEvent(int button) : MouseButtonEvent(button)
        {
        }

        std::string ToString() const override
        {
            std::stringstream ss;
            ss << "MouseButtonReleasedEvent:"
               << "button" << m_Button;
            return ss.str();
        }

#ifdef ORANGE_VS
        EVENT_CLASS_TYPE(MouseButtonReleased);
#else
        static EventType GetStaticEventType()
        {
            return EventType::MouseButtonReleased;
        };
        virtual EventType GetEventType() const override { return GetStaticEventType(); };
        virtual const char *GetName() const override { return "MouseButtonReleased"; };
#endif
    };
}